#ifndef pktoondb_Server_h
#define pktoondb_Server_h

#include "RecordBase.h"

namespace pktoondb
{
	class Server
		: public RecordBase
	{
	public:
		Server(void);
		~Server(void);
		DECLARE_DEFAULT_RECORD(Server, servers)

	public:
		int GetServerId() const;

	public:
		static Server* FindByServerName(const std::string& serverName);

		static int InsertRegistryService(const std::string& serverName);
		static int InsertResourceService(const std::string& serverName);
		static int InsertDispatchService(const std::string& serverName);

		static int CountRegistryService();
		static int CountDispatchService();
		static int CountResourceService();

		static bool IsServerExist(const std::string& serverName);

	private:
		static int CountService(int type);

	private:
		static const int REGISTRY_CATEGORY;
		static const int DISPATCH_CATEGORY;
		static const int RESOURCE_CATEGORY;
	};
}	

#endif

